"""empty message

Revision ID: 8be78b72e941
Revises: 98335482f277
Create Date: 2018-05-18 10:05:52.151204

"""
from alembic import op
import sqlalchemy as sa
import sqlalchemy_utils


# revision identifiers, used by Alembic.
revision = '8be78b72e941'
down_revision = '98335482f277'
branch_labels = None
depends_on = None


def upgrade():
    STATUS = (
        ('waiting', '等待中'),
        ('running', '执行中'),
        ('success', '成功'),
        ('failed', '失败'),

    )
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('f_task',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('task_name', sa.String(length=200), nullable=False),
    sa.Column('task_title', sa.String(length=1000), nullable=True),
    sa.Column('task_key', sa.String(length=100), nullable=True),
    sa.Column('is_run', sa.BOOLEAN(), nullable=True),
    sa.Column('status', sqlalchemy_utils.types.choice.ChoiceType(STATUS), nullable=True),
    sa.Column('user_id', sa.Integer(), nullable=True),
    sa.Column('start_time', sa.DATETIME(), nullable=True),
    sa.Column('end_time', sa.DATETIME(), nullable=True),
    sa.Column('run_interval', sa.Integer(), nullable=True),
    sa.Column('max_time', sa.Integer(), nullable=True),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('task_ship',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('user_id', sa.Integer(), nullable=True),
    sa.Column('task_id', sa.Integer(), nullable=True),
    sa.Column('task_info_id', sa.Integer(), nullable=True),
    sa.PrimaryKeyConstraint('id')
    )
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_table('task_ship')
    op.drop_table('f_task')
    # ### end Alembic commands ###
